<?php
class CreateWordController extends Yaf_Controller_Abstract
{
	public function init()
	{
		Yaf_Loader::import('import.php');
	}

	/**
	 * 首页
	 * @method indexAction
	 * @return [type]      [description]
	 * @author NewFuture
	 */
	public function indexAction()
	{   
		//$zip = new ZipArchive();
		$param["ProtocolNumber"] = "MZH20160803";
		$param["Date"] = "2016-08-12";
		$param["SellerAddress"] = "96 LINWOOD PLAZA 135,FORT LEE, NJ 07024USA";
		$param["Seller"] = "XINHUA MEDIA AND INVESTMENT LLC";
		$param["Buyer"] = "HUA XING NORTH AUTO TRADE CO., LTD";
		$param["BuyAddress"] = "NO. 6, TAIHU ROAD, HEXI DISTRICT, TIANJIN, CHINA 300461";
		$param["Quantity"] = "10";
		$param["description"] = "2016 SUNLIGHT C42 D NJOY";
		$param["UnitPrice"] = "EUR 8,115";
		$param["RowPrice"] = "EUR 81,150";
		$param["CellPrice"] = "EUR 81,150";
		$param["TotalNum"] = "10";
		$param["description"] = "asd";
		$placeHolder["description"] = '${description}';
		$placeHolder["Color"] ="red";
		$placeHolder["UnitPrice"] = '${UnitPrice}';
		$placeHolder["Quantity"] ='${Quantity}';
		$placeHolder["RowPrice"] ="3444";
		$filePath = word::createWord("pufa",$param,HTML_TPL."temFile/pufa.docx",true,"description",4,$placeHolder);
		$filePath1 = word::createWord("yubao",$param,HTML_TPL."temFile/预投保险.docx",true,"description",0,$placeHolder);
		//upload::uploadWordFile($filePath,"",$filePath1);
		$Path = substr($filePath,0,strrpos($filePath,"/"));
		//echo $Path;
		//$Path[1] = $filePath1;
		$down = new downloadMore();
		$down->download($Path);
	}
}
?>
